<?php
  session_start();
  if(!isset($_SESSION['authorized']))
     header('Location: UnauthorizedUser.php');
  

  if($_SESSION['authorized'] == 0)
     header('Location: UnauthorizedUser.php');  
     
  $userType = $_SESSION['userType'];
  if($userType != 2)
     header('Location: UnauthorizedUser.php');   

?>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-9">
<title>Vice Program Coordinator Operations</title>
</head>

<body>

<?php include 'top.html' ?>
<?php include 'notifier.php' ?>

<p>
<table border="1" id="table1" cellpadding="5">
	<tr>
		<td width="150"><b><font color="#FF0000">Students </font></b></td>
		<td width="230"><b><font color="#FF0000">Courses</font></b></td>
		<td width="200"><b><font color="#FF0000">Instructors</font></b></td>
		<td width="200"><b><font color="#FF0000">Budget</font></b></td>
		<td width="200"><b><font color="#FF0000">Program</font></b></td>
	</tr>
	
	<?php
			
	require_once 'commonutils/db/DBConnectionManager.php';
		
		$sqlquery = "select userType, programCode from user where userName = '".$_SESSION['uname']."'";
  	  $result = DBConnectionManager::query($sqlquery);
  	  $row = mysql_fetch_assoc($result);
  	  $userType = $row['userType'];
  	  $programCode = $row['programCode'];
  	  
  	  $BudgetFormLink = "";
	  $NonProg = "";
	  $Prog = "";
	   
	  if($programCode == 9040){
	     $BudgetFormLink = "budget/ui/IONBudgetForm.php";
	     $NonProg = "budget/ui/NonPorgStudTakingIONCoursesForm.php";
	     $Prog = "budget/ui/IONStudTakingNonProgCoursesForm.php";
	     }
	  else if($programCode == 9030 ){
       $BudgetFormLink = "budget/ui/MSBudgetForm.php";
	     $NonProg = "budget/ui/NonPorgStudTakingMSCoursesForm.php";
	     $Prog = "budget/ui/MSStudTakingNonProgCoursesForm.php";
	  }
	  else if($userType == 9050){
       $BudgetFormLink = "budget/ui/SMBudgetForm.php";
	     $NonProg = "budget/ui/NonPorgStudTakingSMCoursesForm.php";
	     $Prog = "budget/ui/SMStudTakingNonProgCoursesForm.php";
	  }
	  else if($userType == 9070){
	     $BudgetFormLink = "budget/ui/WBLSBudgetForm.php";
	     $NonProg = "budget/ui/NonPorgStudTakingWBLSCoursesForm.php";
	     $Prog = "budget/ui/WBLSStudTakingNonProgCoursesForm.php";
	  }	 
  	  
  	?> 
  	
	<tr style="margin-left:100px ">
		<td valign="top" style="margin-left:100px " width="340">
			<a href="education/ui/SearchStudent.php">View Student Details</a><br>
			<?php
				if($NonProg != ""){
					echo "<a href= $NonProg >View Non-Program Students Taking This Program Courses Details</a><br>";
					echo "<a href= $Prog>Program Students Taking Non-Program Courses Details</a><br>"; 
				}
			?>
		</td>
		<td valign="top" width="150">
			<a href="education/ui/ViewDefinedCourses.php">View Defined Courses</a><br>
		</td>
		<td valign="top" width="190">
			<a href="personnel/ui/ViewInstructorCourse.php">View Instructor Course Details</a><br>
		</td>
		<td valign="top" width="190">
			<a href="budget/ui/StudentPaymentForm.php">Student Payments</a><br>
			<a href="budget/ui/InstructorPaymentForm.php">Instructor Payments</a><br>
			<a href="budget/ui/AdminStaffAndRAPaymentForm.php">Administrative Staff And Research Assistant Payments</a><br>
			
			<?php
				if($BudgetFormLink != ""){
					echo "<a href= $BudgetFormLink>View Program Budget Details</a><br>";
				}
			?>
			
		</td>
		<td valign="top" style="margin-left:100px " width="190">
			<a href="enrollment/ui/AddProgramDetails.php">Add Program Details</a><br>
			<a href="commonutils/csv/fileBrowser.html">Import Data from OIBS DBDump</a><br>
		</td>
	</tr>
</table>
</body>
</html>
